///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package utilfile;
//
//import DBMS.DataBaseManager;
//import clases.Unidad;
//import java.util.ArrayList;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import org.apache.struts.action.ActionForm;
//import org.apache.struts.action.ActionForward;
//import org.apache.struts.action.ActionMapping;
//import org.apache.struts.actions.DispatchAction;
//
///**
// *
// * @author andreth
// */
//public class ConsultarMatriz extends DispatchAction {
//
//    /* forward name="success" path="" */
//    private static final String SUCCESS = "success";  
//    private static final String FAILURE = "failure";    
//    private static final String PAGE = "page"; 
//    private static final String SOME = "some";
//    /**
//     * This is the action called from the Struts framework.
//     * @param mapping The ActionMapping used to select this instance.
//     * @param form The optional ActionForm bean for this request.
//     * @param request The HTTP Request we are processing.
//     * @param response The HTTP Response we are processing.
//     * @throws java.lang.Exception
//     * @return
//     */
//    public ActionForward all(ActionMapping mapping, ActionForm form,
//            HttpServletRequest request, HttpServletResponse response)
//            throws Exception {
//        request.setAttribute("matrices", DataBaseManager.getInstance().consultarMatrices());
//        return mapping.findForward(PAGE);
//    }
//    
//    public ActionForward some(ActionMapping mapping, ActionForm form,
//            HttpServletRequest request, HttpServletResponse response)  throws Exception{
//        Unidad uni = new Unidad();
//        MatrizFile matriz= (MatrizFile) form;
//        uni.setCodigo(matriz.getUnidad());
//        request.setAttribute("matrices",matrices);
//        if(matrices.isEmpty()){
//            matriz.setMensaje("No hay resultados para la unidad "+uni.getCodigo());
//            return mapping.findForward(FAILURE);
//        }else{
//            matriz.setMensaje("Resultados de la Matriz para la unidad:"+uni.getCodigo());;
//        }
//        request.setAttribute("matriz",matriz);
//        return mapping.findForward(SOME);
//    }
//}
